package com.qijian.maindata.enums;

import cn.hutool.core.util.StrUtil;
import com.qijian.common.exception.ServiceException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum OutType {

    ORDER("order", "外协订单"), OUTBOUND("outbound", "外协出库"), INSPECTION("inspection", "外协报检"), CHECK("check", "外协检验"),FNISH("fnish","完工"), SHIP("ship", "发货"),INBOUND("inbound", "委外入库"), INVOICE("invoice", "委外发票");
    private String value;

    private String label;

    public static OutType getEnumByValue(String value) {

        for (OutType outType : OutType.values()) {
            if (StrUtil.equals(outType.getValue(), value)) {
                return outType;
            }

        }

        throw new ServiceException("类型错误");

    }


}
